﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ESRI.ArcGIS.Geometry;

namespace Bes.Swsp.ToolBox
{
  /// <summary>
  /// A class representing the overland flow from an outlet to a downstream inlet or terminal discharge point (e.g. "state waters").
  /// </summary>
  public class FlowLine : Conveyance
  {
    public FlowLine()
      : base()
    {
      this.IsSubSurface = false;
    }

    public FlowLine(int id)
      : base(id)
    {
      this.IsSubSurface = false;
    }

    /// <summary>
    /// The outlet which is the source of this flow.
    /// </summary>
    public OutletNode SourceOutlet
    {
      get
      {
        return this.UpstreamNode as OutletNode;
      }

      internal set
      {
        this.UpstreamNode = value;
      }
    }

    public override bool IsSubSurface
    {
      get
      {
        return false;
      }
      set
      {
        if (value != false)
        {
          throw new InvalidOperationException("Flowlines cannot be made subsurface, they are always overland.");
        }
      }
    }
  }
}
